package com.kason.framework.protocol.http;

import com.kason.framework.Invocation;
import com.kason.framework.Protocol;
import com.kason.framework.Remote;

import java.net.URL;

/**
 * @author 卢清波
 * @date 2021/2/19 17:18
 */
public class HttpProtocol implements Protocol
{
    public void start(Remote remote)
    {
        HttpServer httpServer = new HttpServer();
        httpServer.start(remote.getHostname(),remote.getPort());
    }

    public String send(Remote remote, Invocation invocation) throws Exception
    {
        HttpClient client = new HttpClient();
        String result = client.send(remote, invocation);
        return result;
    }
}
